<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$iso = explode( '=', _ISO );

echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <?php mosShowHead(); ?>

        <?php
        $collspan_offset = (mosCountModules('right') + mosCountModules('user2')) ? 2 : 1;
        $user1		= 0;
        $user2		= 0;
        $colspan	= 0;
        $right		= 0;

        if (mosCountModules('user1') + mosCountModules('user2') == 2) {
            $user1		= 2;
            $user2		= 2;
            $colspan	= 3;
        } elseif (mosCountModules('user1') == 1) {
            $user1		= 1;
            $colspan	= 1;
        } elseif (mosCountModules('user2') == 1) {
            $user2		= 1;
            $colspan	= 1;
        }

        if (mosCountModules('right') and (empty($_REQUEST['task']) || $_REQUEST['task'] != 'edit')) {
            $right = 1;
        }
        ?>
        <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
        <link href="<?php echo $mosConfig_live_site;?>/templates/default/template.css" rel="stylesheet" type="text/css"/>

    </head>

    <body>
        <div align="center">
            <table border="0" cellpadding="0" cellspacing="0" width="808">
                <tr>
                    <td class="outline">
                        <div id="pathway_outer">
                            <div id="pathway_inner">
                                <div id="buttons">
                                    <?php mosLoadModules('user3', -1); ?>
                                </div>
                            </div>
                        </div>
                        <div id="search_outer">
                            <div id="search_inner">
                                <?php mosLoadModules('user4', -1); ?>
                            </div>
                        </div>
                        <div class="clr"></div>
                        <div id="header_outer">
                            <div id="header">
                                &nbsp;
                            </div>
                            <div id="top_outer">
                                <div id="top_inner">
                                    <?php if (mosCountModules('top')): ?>
                                    <?php mosLoadModules('top'); ?>
                                    <?php else: ?>
                                        <span class="error">Top Module Empty</span>
                                    <?php endif ?>
                                </div>
                            </div>
                        </div>
                        <div id="left_outer">
                            <div id="left_inner">
                                <?php mosLoadModules('left'); ?>
                            </div>
                        </div>
                        <div id="content_outer">
                            <div id="content_inner">

                                <table border="0" cellpadding="0" cellspacing="0" width="100%" class="content_table">
                                    <tr valign="top">
                                        <td width="99%">
                                            <table border="0" cellpadding="0" cellspacing="0" width="100%" class="content_table">

                                            <?php if ($colspan > 0): ?>
                                                <tr valign="top">
                                                    <?php if ($user1 > 0): ?>
                                                        <td width="50%">
                                                            <div class="user1_inner">
                                                                <?php mosLoadModules('user1'); ?>
                                                            </div>
                                                        </td>
                                                    <?php endif ?>
                                                    
                                                    <?php if ($colspan == 3): ?>
                                                        <td width="2">
                                                            <img src="<?php echo $mosConfig_live_site;?>/templates/rhuk_solarflare_ii/images/spacer.png" alt="" title="spacer" border="0" height="10" width="2"/>
                                                        </td>
                                                    <?php endif ?>

                                                    <?php if ($user2 > 0): ?>
                                                        <td width="50%">
                                                            <div class="user2_inner">
                                                                <?php mosLoadModules('user2'); ?>
                                                            </div>
                                                        </td>
                                                    <?php endif ?>
                                                </tr>
                                                <tr>
                                                    <td colspan="<?php echo $colspan; ?>">
                                                        <img src="<?php echo $mosConfig_live_site;?>/templates/rhuk_solarflare_ii/images/spacer.png" alt="" title="spacer" border="0" height="2" width="100"/><br />
                                                    </td>
                                                </tr>
                                            <?php endif ?>

                                                <tr>
                                                    <td colspan="<?php echo $colspan; ?>" class="body_outer">
                                                        <?php mosMainBody(); ?>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>

                                        <?php if ($right > 0): ?>
                                            <td>
                                                <div id="right_outer">
                                                    <div id="right_inner">
                                                        <?php mosLoadModules('right'); ?>
                                                    </div>
                                                </div>
                                            </td>
                                        <?php endif ?>

                                    </tr>
                                </table>
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <?php include_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/footer.php' ); ?>
    </body>
</html>